package com.suanfa.sort;

/**
 */
public class Xier extends SuanFaTemplate{
    public static void main(String[] args){
        Xier selection = new Xier();
        double[] arr = selection.getRandomArray(64000);
        long time=selection.run(arr);
        System.out.print("time cost : "+time);
    }

    public long run(double[] arr){
        long t1 = System.currentTimeMillis();
        for(int i=0;i<arr.length;i++){
            int min=i;
            for(int j=i+1;j<arr.length;j++){
                if(less(arr[j],arr[min])){
                    min=j;
                }
            }
            exchange(arr,i,min);
        }
        long t2 = System.currentTimeMillis();
        return t2-t1;
    }
}
